import React from 'react'

const allMessages = [
    {id: 1, title: 'message001', content: "我爱你，中国1"},
    {id: 3, title: 'message003', content: "我爱你，中国3"},
    {id: 5, title: 'message005', content: "我爱你，中国5"}
];
export default function MessageDetail(props) {
    const {id} = props.match.params;
    const message = allMessages.find((m) => m.id === id * 1); // 返回第一个结果为true的数组元素
    debugger
    return (
        <ul>
            <li>ID：{message.id}</li>
            <li>TITLE：{message.title}</li>
            <li>CONTENT：{message.content}</li>
        </ul>
    );
};